package com.bwie;

import com.github.tobato.fastdfs.FdfsClientConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@MapperScan("com.bwie.mapper")
@Import(FdfsClientConfig.class)
@EnableScheduling
@EnableFeignClients
public class ShopApplication {
    public static void main(String[] args) {
        SpringApplication.run(ShopApplication.class, args);
    }

    /**
     * @description 创建RedissonClient对象
     * @params []
     * @return org.redisson.api.RedissonClient
     * @author 军哥
     * @date 2025/6/27 9:10
     */
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();

        config.useSingleServer().setAddress("redis://192.168.80.192:6379");

        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }
}